<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">

$(function(){

	cbCondition();
	
	$('#bnkNo').autocomplete({
    	serviceUrl: '<%=request.getContextPath()%>/bank_auto.html',
    	minChars:1,
    	paramName:'bnkNo',
    	transformResult: function(response) {
		　　return {
		　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
		　　　　　　return { value: dataItem.bnkNo, data: dataItem.bnkName};
		　　　　})
		　　};
		},
    	formatResult:function (suggestion, currentValue) {
    		return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
    	}
	});

	$("#dataTable").datagrid({
		toolbar: '#dataSearch',
		fitColumns:true,
		striped: true, 
		singleSelect:false,
		pagination:true,
		rownumbers:true,
		SelectOnCheck:true,
		CheckOnSelect:true,
        onSelect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onSelectAll: function(rows){
        	var nos="";
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselectAll: function(rows){
			$("#keys").val("");
    	}
	});
	
	$('#dataTable').datagrid('getPager').pagination({
		total:<s:property value="pageInfo.pageRecord"/>,
		pageNumber:<s:property value="pageInfo.pageIndex"/>,
		pageSize:<s:property value="pageInfo.pageSize"/>,
		pageList: [20,50,100] ,
		onSelectPage:function(pageNumber,pageSize){  
			toPage(pageNumber,pageSize);
		},
		onRefresh:function(pageNumber,pageSize){  
			location.reload();
		}
	});
	
});
function cbCondition(){
	if($("#high").prop("checked")){
		$(".ac").show();
	}else{
		$(".ac").hide();
	}
}

</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="cb_listreturn.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr>
<td height="25" >
	<b>操作说明:多个流水号直接用逗号分隔</b> 
</td>
</tr>
<tr><td height="30" >
<s:textfield  id="cbNo" name="cbNo" placeholder="流水号" cssStyle="width:240px;" ></s:textfield>
<s:textfield  id="bnkNo" name="bnkNo"  placeholder="收单银行" cssStyle="width:200px;" ></s:textfield>
<s:textfield  id="txnNo" name="txnNo" placeholder="关联交易号" cssStyle="width:200px;" ></s:textfield>
<s:select id="cbType" name="cbType"  list="@dicts.PaymentDict@CB_TYPE" headerKey="" headerValue="出账类型"/>
<s:select id="cbState" name="cbState"  list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="出账状态"/>
<s:select id="cbCstate" name="cbCstate"  list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="对账状态"/>

<input type="button" class="submit" value="提交查询" onclick="sform.submit();"/>
<input type="button" class="submit" value="高级搜索" onclick="$('#high').click();"/>
<s:checkbox id="high" name="high"  onclick="cbCondition();" cssStyle="display:none;"></s:checkbox>
</td></tr>
<tr><td><hr/></td></tr>
<tr class="ac"  style="display: none;"><td height="30" >
<s:textfield  id="cbRef" name="cbRef"  placeholder="返回银行单号" cssStyle="width:240px;" ></s:textfield>
<s:textfield  id="cbMark" name="cbMark" placeholder="返回码" cssStyle="width:240px;" ></s:textfield>
<s:textfield  id="cbInfo" name="cbInfo" placeholder="返回信息" cssStyle="width:240px;" ></s:textfield>

<s:textfield  id="cbDateTop"  name="cbDateTop" placeholder="出账日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="cbDateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="cbDateEnd"  name="cbDateEnd" placeholder="出账日期止"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="cbDateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>
<s:textfield  id="cbCdateTop"  name="cbCdateTop" placeholder="对账日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="cbCdateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="cbCdateEnd"  name="cbCdateEnd"  placeholder="对账日期止" onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="cbCdateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>

</td></tr>
<tr class="ac"  style="display: none;"><td><hr/></td></tr>
<tr>
<td height="30" >
	<input type="hidden"  id="keys" name="keys"  value=""/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="编号排序" onclick="toSort('sortField','cbNo')"/>
		<input type="button" class="submit" value="日期排序" onclick="toSort('sortField','cbDate')"/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" class="submit" value="升序排列" onclick="toSort('sortOrder','true')"/>
		<input type="button" class="submit" value="降序排列" onclick="toSort('sortOrder','false')"/>
</td>
</tr>
</table>
</form>
</div>

<table id="dataTable" style="width: 100%;" class="easyui-datagrid" >
<thead>
<tr>
<th data-options="field:'ck'" checkbox="true"></th>
<th data-options="field:'cbNo', width:'13%',align:'left' , halign: 'left'">编号</th>
<th data-options="field:'bnkNo', width:'8%',align:'left' , halign: 'left'">收单银行</th>
<th data-options="field:'txnNo', width:'11%',align:'left' , halign: 'left'">关联交易号</th>
<th data-options="field:'cbType', width:'6%',align:'left' , halign: 'left'">类型</th>
<th data-options="field:'cbRef', width:'10%',align:'left' , halign: 'left'">返回银行单号</th>
<th data-options="field:'cbInfo', width:'12%',align:'left' , halign: 'left'">返回信息</th>
<th data-options="field:'cbAmount', width:'6%',align:'left' , halign: 'left'">出账金额</th>
<th data-options="field:'cbState', width:'2%',align:'left' , halign: 'left'">出</th>
<th data-options="field:'cbDate', width:'10%',align:'left' , halign: 'left'">出账日期</th>
<th data-options="field:'cbRemark', width:'15%',align:'left' , halign: 'left'">备注信息</th>
<th data-options="field:'op', width:'100',align:'left' , halign: 'left'">操作</th>

</tr>
</thead>
<tbody>
<s:iterator value="cbList" id="show" status="seq">
<tr>
<td><s:property value="#show.cbNo"/></td>
<td><a href="<%=request.getContextPath()%>/cb_show.html?cbNo=<s:property value="#show.cbNo"/>"><s:property value="#show.cbNo"/></a></td>
<td><a href="<%=request.getContextPath()%>/bank_show.html?bnkNo=<s:property value="#show.bnkNo"/>"><s:property value="#show.bnkNo"/></a></td>
<td><a href="<%=request.getContextPath()%>/transaction_show.html?txnNo=<s:property value="#show.txnNo"/>"><s:property value="#show.txnNo"/></a></td>
<td><s:property value="#show.cbType"/></td>
<td><s:property value="#show.cbRef"/></td>
<td>[<s:property value="#show.cbMark"/>]<s:property value="#show.cbInfo"/></td>
<td><s:text name="global.format.number"><s:param value="#show.cbAmount"/></s:text></td>
<td><s:if test="#show.cbState==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:text name="global.format.dateminute"><s:param value="#show.cbDate"/></s:text>
<td><s:property value="#show.cbRemark"/></td>
<td>
	<input type="button" value="退审" style="width: 50px;" class="submit" onclick="location.href='<%=request.getContextPath()%>/cb_editreturn.html?cbNo=<s:property value="#show.cbNo"/>'"/>
</td>

</tr>
</s:iterator>
</tbody>
</table>
<br/>
<br/>
<br/>
</body>
</html>
